<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/*
 * C_Customers_List
 *
 * 用户列表功能实现类
 *
 */

class C_Customers_List extends MY_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('System_Model');
        $this->load->model('Customers_Model');
    }

    /*
     * index
     * 初始化
     */

    public function index() {
        $data['title'] = $this->System_Model->get_system('login_title');
        //获取列表,状态为有效
        $data['listView'] = $this->Customers_Model->GetListForState(OBJ_STATE_VALID);

        $this->load->view('layout/header', $data);
        $this->load->view('layout/menu');
        $this->load->view('customers/customers_list_view');
        $this->load->view('layout/footer');
    }

    //删除内容
    function delete($id = FALSE) {
        $data = array(
            'cu_state' => OBJ_STATE_INVALID
        );
        $this->Customers_Model->Del($id, $data);
        redirect('customers/C_Customers_List/index');
    }

    //主页更多内容
    function main($param) {
        $data['title'] = $this->System_Model->get_system('login_title');
        switch ($param) {
            case 1:
                $data["menutitle"] = "到期提醒";
                $value = $this->Customers_Model->GetListForMan();
                break;
            case 2:
                $data["menutitle"] = "结婚周年提醒";
                $value = $this->Customers_Model->GetListForAnniversary();
                break;
            case 3:
                $data["menutitle"] = "最新订单";
                $value = $this->Customers_Model->GetListForNew();
                break;
        }
        $data["listView"] = $value;
        $this->load->view('layout/header', $data);
        $this->load->view('layout/menu');
        $this->load->view('customers/customers_main_view', $data);
        $this->load->view('layout/footer');
    }

}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */